package com.itheima.dao;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.*;

public interface UserMapper {
    // 根据id查询用户
    @Select("select * from user where id = #{id}")
    User findById(int id);

    // 插入用户
    @Insert("insert into user(id, name, pwd) values(#{id}, #{name}, #{pwd})")
    int addUser(User user);

    // 更新用户
    @Update("update user set name = #{name}, pwd = #{pwd} where id = #{id}")
    int updateUser(User user);

    // 删除用户
    @Delete("delete from user where id = #{id}")
    int deleteUser(int id);
}